local skynet = require "skynet"
local msghelper = require "authdbsvrhelper"
local base = require "base"
local serverbase = require "serverbase"
require "skynet.manager"

local params = ...

local Authdbsvrd = serverbase:new({
	redisdb_service = {},
	mysqldb_service = {},
})

function Authdbsvrd:tostring()
	return "Authdbsvrd"
end

local function Authdbsvrd_to_sring()
	return Authdbsvrd:tostring()
end

function  Authdbsvrd:init()
	msghelper:init(Authdbsvrd)
	self.eventmng.init(Authdbsvrd)
	self.eventmng.add_eventbyname("cmd", "authdbsvrcmd")
	self.eventmng.add_eventbyname("dao", "authdbsvrdao")
	
	Authdbsvrd.__tostring = Authdbsvrd_to_sring
end 

skynet.start(function()  
	if params == nil then
		Authdbsvrd:start()
	else		
		Authdbsvrd:start(table.unpack(base.strsplit(params, ",")))
	end	
end)
